# -*- coding: utf-8 -*-
"""
Created on 2019/11/29 下午4:56

@Project -> File: ode-neural-network -> __init__.py.py

@Author: luolei

@Describe: 初始化
"""

import sys

sys.path.append('../')

from mod.config.config_loader import config

proj_cmap = config.proj_cmap

# 设备操作参数
ca_0 = config.conf['ca_0']
T_0 = config.conf['T_0']
q = config.conf['q']

# ode模拟运行参数
dt = config.conf['dt']
steps = config.conf['steps']
obs_n = config.conf['obs_n']
inits_n = config.conf['inits_n']

# 字段变量参数
cols = config.conf['cols']
col_bounds = config.conf['col_bounds']

# ODE Net参数
discrete_t_steps = config.conf['discrete_t_steps']
epochs = config.conf['epochs']
lr = config.conf['lr']

cols_n = cols.__len__()


def normalize(data):
	"""
	各字段归一化
	:param data:
	:return:
	"""
	
	data = data.copy()
	for col in cols:
		bounds = col_bounds[col]
		data[col] = data[col].apply(lambda x: (x - bounds[0]) / (bounds[1] - bounds[0]))
	return data


__all__ = [
	'proj_cmap',
	'dt', 'steps', 'obs_n', 'inits_n',
	'cols', 'col_bounds', 'cols_n',
	'discrete_t_steps', 'epochs', 'lr',
	
	'normalize'
]


